home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 2.8 KB | 91 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1993 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Programmer: Kent Sandvik
- Date: 1/5/93
- Revision comments are at the end of this file.
- ---
- TVolume is a simple volume based utility class (provides information about volumes)
- TVolume.h contains the TVolume class definitions.
- _________________________________________________________________________________________________________ */
-
- // Declare label for this header file
- #ifndef _VOLUME_
- #define _VOLUME_
-
- #ifndef _DTSCPLUSLIBRARY_
- #include "DTSCPlusLibrary.h"
- #endif
-
- // TOOLBOX HEADER FILES
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __FOLDERS__
- #include <Folders.h>
- #endif
-
- #ifndef __ERRORS__
- #include <Errors.h>
- #endif
-
-
- // _________________________________________________________________________________________________________ //
- // TVolume Class Interface.
- class TVolume
- // TVolume will provide volume level information about mounted volumes.
- {
- public:
- // CONSTRUCTORS AND DESTRUCTORS
- TVolume(); // default constructor
- TVolume(short refNum); // constructor that accepts a volume refnum
- virtual~ TVolume(); // default destructor
-
- // MAIN INTERFACE
- virtual short GetBootVRefNum(); // find out the VRefNum of the boot volume
- virtual long GetKFreeSpace(); // get amount of free space (Kb) on volume
- virtual long GetFileCount(); // return amount of files on volume
- virtual long GetDirCount(); // return amount of folders on volume
- virtual long GetCreationDate(); // return creation date of volume
- virtual short GetDriverNumber(); // get actual driver number
- virtual Boolean GetName(Str255& name); // get driver FSSpec
- virtual short GetNumVolumes(); // get # of mounted volumes
-
- // ITERATORS
- virtual void Reset(); // get back to boot volume
- virtual Boolean Last(); // last volume?
- virtual void Next(); // iterate to next volume
-
- // INTERNAL FUNCTIONS
- virtual Boolean GetHParamBlock(); // generate a lookup in a pre-defined param block
-
- // GET/SET FUNCTIONS
- virtual void SetVRefNum(const short refNum);// set used VRefNum
- virtual short GetVRefNum() const; // get currently used VRefNum
-
- // FIELDS
- protected:
- short fVRefNum; // the volume VRefNum
- HParamBlockRec fPB; // paramBlock rec used everywhere
- OSErr fError; // latest error
- short fIndex; // volume index
- Boolean fLast; // indicator if we have the last volume
- };
-
-
- #endif
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 1/5/93 New file
- 2 khs 1/7/93 Cleanup
- */
-